
import numpy as np
import cv2 as cv

# 创建16*16黑底照片
img = np.zeros((16,16,3),np.uint8)
cv.imshow('1_origin_img',img)

# 获取像素值
pixel_value = img[10,10]
print(pixel_value) # --> array([0, 0, 0], dtype=uint8)

# 修改像素值
img[10,10] = [255,255,255]

# 显示图片
cv.imshow('2_modify_pixel_img',img)
cv.waitKey(0)
cv.destroyAllWindows()